#!/usr/bin/ruby

require 'bio'
require 'soap/wsdlDriver'

wsdl = "http://soap.genome.jp/KEGG.wsdl"
serv = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
serv.generate_explicit_type = true

entry = ARGV[0]

#Get KO entry from KEGG
et = serv.bget("ko:#{entry}")

#Set up MODULE object
o = Bio::KEGG::ORTHOLOGY.new(et)

#pathway = o.pathways_as_hash
#pathway_key = pathway.keys
#pathway_val = pathway.values
#print o.pathways, "\t", o.modules, "\n"

print o.entry_id, "\t", o.name, "\t", o.definition, "\n"

